package com.leesche.netdoll.communication.protocol.encoder;

import org.apache.commons.lang3.math.NumberUtils;

import com.leesche.framework.core.codec.EndianUtil;

public class IntegerLEncoder implements Encoder {

	@Override
	public byte[] encode(Object value) {
		value = value == null ? 0 : value;
		return EndianUtil.encodeUnsignedIntegerLE((NumberUtils.createDouble(value.toString()).longValue()));
	}

}
